<script setup>
import useUserStore from '@/store/modules/user'
import useSetStore from '@/store/modules/set'
import { checkPermi, checkRole } from "@/utils/permission"
import { getToken } from '@/utils/auth';
import { onMounted, ref } from 'vue';
import { licationTime } from '@/utils/config.js'
import { timeFormat } from 'uview-plus'
import { onShow, onReady } from '@dcloudio/uni-app';

const setStore = useSetStore()
const tyUrl = uni.getStorageSync('tyUrl')
if (tyUrl) {
	setStore.setBaseUrl(tyUrl)
}
const userStore = useUserStore()

onMounted(async() => {
	const token = getToken()
	setStore.getEnv()
	if (token) {
		await userStore.getInfo()
	} else {
		uni.redirectTo({
			url: '/pages/login'
		})
	}
})
</script>

<style lang="scss">
@import "uview-plus/index.scss";
@import '@/static/scss/index.scss';
</style>